new Vue({
    el: "#app",
    data: {
        flowList: []
    },
    created: function () {
        //调用方法
        this.findAll();
    },
    methods: {
        //到后台获取列表数据
        findAll: function () {
            axios.get('/flow/findAll')
                .then((result) => {
                    this.flowList = result.data;
                });
        },
        deploy: function (id) {
            console.log('部署流程定义：', id)
            axios.put('/flow/deployment/' + id).then((result) => {
                if (result.data === 1) {
                    alert('部署成功！');
                } else if (result.data === 2) {
                    alert('已经部署过！');
                } else {
                    alert('部署失败！！')
                }
                this.findAll();
            });
        }
    }
});
